{include file="common/header.tpl"}
<section class="main">
	<nav class="left-col">{include file="common/navi-share.tpl"}</nav>
    <article class="right-col">
		<h2><a href="{$smarty.const.HOST_BACKEND}smanual/index">Cẩm nang</a> &raquo; Thêm mới</h2>
        <form name="frmAdd" id="frmAdd" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}smanual/save" class="ui">
            <ul>
            	{if isset($smarty.session.SHARE_MANUAL_ERROR)}
                    <li class="error">
                       {include file="common/error.tpl" dataSession=$smarty.session.SHARE_MANUAL_ERROR}    
                    </li>
                {/if}
                <li>
                    <label for="pcategoryid">Phân loại <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="pcategoryid" name="pcategoryid" onchange="javascript:loadSub(this.value,'psubid');">
                            <option value="0">---Chọn--</option>
                            {foreach item=item from=$arrCategory}
                            	<option value="{$item.categoryid}" {if isset($smarty.session.SHARE_MANUAL_POST.pcategoryid) && $smarty.session.SHARE_MANUAL_POST.pcategoryid == $item.categoryid}selected="selected"{/if}>{$item.name}</option>
                            {/foreach}
                        </select>
                    </div>
                </li>                            
                <li>
                    <label for="psubid">Chuyên mục <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="psubid" name="psubid">
                            <option value="0">---Chọn--</option>
                            {if isset($arrSub)}
                                {foreach item=item from=$arrSub}
                                    <option value="{$item.categoryid}" {if isset($smarty.session.SHARE_MANUAL_POST.psubid) && $smarty.session.SHARE_MANUAL_POST.psubid == $item.categoryid}selected="selected"{/if}>{$item.name}</option>
                                {/foreach}
                            {/if}
                        </select>
                    </div>
                </li>
                <li>
                    <label for="ptitle">Tiêu đề <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="ptitle" id="ptitle" value="{if isset($smarty.session.SHARE_MANUAL_POST.ptitle)}{$smarty.session.SHARE_MANUAL_POST.ptitle}{/if}" maxlength="{$smarty.const.VL_NAME_MAXLENGTH}" />
                    </div>
                </li>
                <li>
                    <label for="pimage">Hình minh họa <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="file" class="text" name="pimage" id="pimage" value="" />
                    </div>
                </li>
                <li>
                    <label for="pflash">Flash / video:</label>
                    <div class="area">
                    	<textarea id="pflash" name="pflash" rows="0" cols="0">{if isset($smarty.session.SHARE_MANUAL_POST.pflash)}{$smarty.session.SHARE_MANUAL_POST.pflash}{/if}</textarea>
                    </div>
                </li>
                <li>
                    <label for="pshort">Tóm lược:</label>
                    <div class="area">
                    	<textarea id="pshort" name="pshort" rows="0" cols="0">{if isset($smarty.session.SHARE_MANUAL_POST.pshort)}{$smarty.session.SHARE_MANUAL_POST.pshort}{/if}</textarea>
                    </div>
                </li>
                <li>
                    <label for="pcontent">Nội dung<span class="required">*</span>:</label>
                    <div class="area">
                    	<textarea id="pcontent" name="pcontent" rows="0" cols="0">{if isset($smarty.session.SHARE_MANUAL_POST.pcontent)}{$smarty.session.SHARE_MANUAL_POST.pcontent}{/if}</textarea>
                    </div>
                </li> 
                <li>
                    <label for="plink">Link nguồn:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="plink" id="plink" value="{if isset($smarty.session.SHARE_MANUAL_POST.plink)}{$smarty.session.SHARE_MANUAL_POST.plink}{/if}" maxlength="255" />
                    </div>
                </li>  
                <li>
                    <label for="ptag">Tag:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="ptag" id="ptag" value="{if isset($smarty.session.SHARE_MANUAL_POST.ptag)}{$smarty.session.SHARE_MANUAL_POST.ptag}{/if}" maxlength="{$smarty.const.VL_TAG_MAXLENGTH}" />
                    </div>
                </li>                                                      
                <li>
                	<button type="submit">Lưu dữ liệu</button>
                    <button type="reset">Nhập lại</button>
                </li>
            </ul>
        </form>
	</article>
</section>
{include file="common/footer.tpl"}
                
